%include
:- lib(ic), lib(listut).

testPersonIsAdult(Path, OState, Arg, Result, NState) :-
	Path > 0,
	% Domains
	[OAge] :: -127 .. 128,
	[NAge] :: -127 .. 128,
	% Constraints
	OState = [OAge],
	NState = [NAge],
	personIsAdult(Path, OState, Arg, Result, NState),
	% Solving
	indomain(OAge),
	indomain(NAge).

personIsAdult(1, [OAge], [], Result, [NAge]) :-
	% Invariant
	NDisplacement #>= 50,
	% Postcondition
	NAge #>= 18,
	Result = true,
	% Object State Update
	NAge #= OAge,
	% Invariant
	NDisplacement #>= 50.

